#ifndef DATASET_H
#define DATASET_H

#include "camera.h"
#include "common.h"
#include "frame.h"

/**
 * 数据集读取
 * 构造是传入配置文件路径，配置文件的dataset_dir为数据集路径
 * init之后可获得相机与下一帧图像
 */
namespace myslam
{

class Dataset
{
public:
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
    typedef std::shared_ptr<Dataset> Ptr;
    Dataset(const std::string&  dataset_path);
    
    //初始化， 返回是否成功
    bool Init();
     
    //create and return the next frame containing the stereo images
    Frame::Ptr NaxtFrame();
    
    //get camera by id
    Camera::Ptr GetCamera(int camera_id) const 
    {
        return cameras_.at(camera_id);
    }
    
private:
    std::string dataset_path_;
    int current_image_index_=0;
    
    std::vector<Camera::Ptr> cameras_;
    
};

}  //namespace myslam

#endif // DATASET_H
